var newsTable;
// 获取基础数据信息
function getEvaluationLabelList(name) {
	if (typeof newsTable !== 'undefined') {
		newsTable.fnPageChange('first');
		return;
	}

	var i = 1;
	newsTable = $("#newsList")
			.DataTable(
					{
						"sAjaxSource" : _path + "/evaluationLabel/queryByPage",
						"fnServerParams" : function(aoData) {
							aoData.push({
								"name" : "labelName",
								"value" : $("#labelName").val()
							}, {
								"name" : "insertTime",
								"value" : $("#insertTime").val()
							}, {
								"name" : "updateTime",
								"value" : $("#updateTime").val()
							}, 
							{
								"name" : "sort",
								"value" : $("#sort").val()
							},{
								"name" : "fromDate",
								"value" : $("#fromDate").val()
							}, {
								"name" : "toDate",
								"value" : $("#toDate").val()
							});
						},
						"sServerMethod" : "POST",
						"sAjaxDataProp" : "dataList",
						"fnCreatedRow" : function() {
							i++;
						},
						"fnPreDrawCallback" : function() {
							i = 1;
						},
						"aoColumns" : [
								{
									"sTitle" : "序号",
									"sWidth" : "2%",
									"mData" : function() {
										return i;
									}
								},
								{
									"sTitle" : "名称",
									"mData" : "labelName",
									"sWidth" : "10%"
								},
								{
									"sTitle" : "类别",
									"mData" : "sort",
									"sWidth" : "10%",
									"mRender" : function(data) {
										var sort = '';
										switch (data) {
										case '1':
											sort = '评测标签';
											break;
										case '2':
											sort = '幼儿园类别';
											break;
										}
										return sort;
									}
								},
								{
									"sTitle" : "创建时间",
									"mData" : "insertTime",
									"sWidth" : "10%"
								},
								{
									"sTitle" : "修改时间",
									"mData" : "updateTime",
									"sWidth" : "10%"
								},
								{
									"sTitle" : "操作",
									"sWidth" : "10%",
									"mData" : function(data) {
										var status = '<a href="'
												+ _path
												+ '/evaluationLabel/edit/'
												+ data.id
												+ '" class="btn default btn-xs purple"><i class="fa fa-edit" title="编辑"></i></a>';
										status += '&nbsp;<a href="javascript:inquiry('
//												+ _path
//												+ '/evaluationLabel/del/'
												+ data.id
												+ ');"  class="btn default btn-xs red"><i class="fa fa-trash-o" title="删除"></i></a>';
										return status;
									}
								} ]
					});
}
function inquiry(id){
	layer.confirm('您确定要删除吗？', {
		  btn: ['确定','取消'] //按钮
		}, function(){
			location.href = _path + "/evaluationLabel/del/" + id;
		}, function(){
		
		});
}